'use strict'

const Controller = require('egg').Controller

class UserController extends Controller {
  async login() {
    const { ctx } = this
    const { code } = ctx.query
    if (!code) {
      return ctx.failure('请传入code')
    }
    await this.ctx.service.user.login(code)
  }
}

module.exports = UserController
